<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
	<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
	request.setCharacterEncoding("UTF-8");
	String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/argeeCommon.jsp" %>
<%@ include file="/WEB-INF/JSP/backHome/modalWindows/againstAuditCommon.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/backLayout.css">
<link rel="stylesheet" type="text/css" href="<%=path%>/CSS/bombBox.css">
</head>
<style>
select{width: 170px;height: 31px}
.gn_name{padding-top: 5px}

.div_zilei {
	width: 94.5%;
	padding-left: 90px;
	height: 30px
}
.tr{height:40px;background: #57a0ff;font-weight:700;}
.tr td{font-size: 14px;color: #ffffff}
.tr_td{height: 40px;}
.tr_td td{border-bottom: 1px solid #ededed;text-align: center;}
tr td:nth-child(1) {font-size: 14px;color: #cccccc}
.date{border: 0;background: #ffffff;text-align: center;}
.tr_td td:nth-child(1){border-left: 1px solid #cccccc;}
.tr_td td:nth-child(3){border-right: 1px solid #cccccc;}
.addTable.deleteTable:HOVER{cursor:pointer;}
input[type='checkbox']{width: 15px}
#table1 input{width: 170px}
#table2 input{width: 170px;}
#table3 input{width: 170px;}
.fseq2{width:25px;border:none;color:#cccccc;text-align: center;}
.div_input_hang select{width: 234px}
.div_input_hang {
	width: 100%;
	height: 40px;
}
.input_hang {
	float: left;
	width: 500px;
	height: 40px;
}
</style>
<body style="background: #f5f5f5">
<div class="main">
<div id="modal-overlay">
			    
			</div>
			<div class="modal-data2">
			<div style="height: 60px">
				<ul>
					<li
						style="text-align: left; margin-left: 60px; height: 40px; line-height: 40px">
						<span>名称：</span> <span> <input class="name" type="text">
					</span> <span>
							<button class="findBtn2">查询</button>
					</span>
					</li>
				</ul>
			</div>
			<div style="width: 1100px; height: 350px; overflow: scroll;">
				<form action="">
					<table class="head2"
						style="width: auto; white-space: nowrap; border-spacing: 0px">
						<tr style="background: #f2f2f2; height: 30px; line-height: 20px;"
							class="sel">
							<td style="width: 20px"></td>
							<td>员工编号</td>
							<td>员工姓名</td>
							<td>部门</td>
							<td>员工类型</td>
							<td>身份证号码</td>
							<td>手机号码</td>
							<td>地址</td>
							<td>出生日期</td>
							<td>入职日期</td>
							<td>转正日期</td>
							<td>离职日期</td>
							<td>合同到期日</td>
							<td>社保编号</td>
							<td>车辆</td>
							<td>性别</td>
							<td>职级职等</td>
							<td>薪酬调整</td>
							<td>岗位异动</td>
							<td>请假记录</td>
							<td>违纪奖励记录</td>
							<td>社会记录</td>
							<td>计算招生提成</td>
							<td>计算培训提成</td>
						</tr>
						<c:forEach items="${persons}" var="persons" varStatus="s">
							<tr style="margin-top: 45px" class="jx">
								<td><input type="checkbox" class="check"
									value="${persons.fid}" name="train" /></td>
								<td>${persons.fnumber}</td>
								<td>${persons.fnameL2}</td>
								<td>${persons.cfpersondepName}</td>
								<c:if test="${empty persons.cfpersontype}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfpersontype == '0'}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfpersontype == '1'}">
									<td>办公室职员</td>
								</c:if>
								<c:if test="${persons.cfpersontype == '2'}">
									<td>教练</td>
								</c:if>
								<c:if test="${persons.cfpersontype == '3'}">
									<td>其他</td>
								</c:if>
								<td>${persons.cfidcardno}</td>
								<td>${persons.cfcell}</td>
								<td>${persons.cfaddress}</td>
								<td>${persons.cfbirthdays}</td>
								<td>${persons.cfbegindate}</td>
								<td>${persons.cfstartdate}</td>
								<td>${persons.cfenddate}</td>
								<td>${persons.cfhtdqsj}</td>
								<td>${persons.cfaccountsno}</td>
								<td>${persons.cfcarName}</td>
								<c:if test="${empty persons.cfsex}">
									<td></td>
								</c:if>
								<c:if test="${persons.cfsex == '1'}">
									<td>男</td>
								</c:if>
								<c:if test="${persons.cfsex == '2'}">
									<td>女</td>
								</c:if>
								<td>${persons.positiongradeName}</td>
								<td>${persons.cfxctz}</td>
								<td>${persons.cfgwyd}</td>
								<td>${persons.cfqjjl}</td>
								<td>${persons.cfwjjljl}</td>
								<td>${persons.cfshjljl}</td>
								<c:if test="${empty persons.cfzstc}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfzstc == '0'}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfzstc == '1'}">
									<td><input type="checkbox" disabled="disabled"
										checked="checked"></td>
								</c:if>
								<c:if test="${empty persons.cfpxtc}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfpxtc == '0'}">
									<td><input type="checkbox" disabled="disabled"></td>
								</c:if>
								<c:if test="${persons.cfpxtc == '1'}">
									<td><input type="checkbox" disabled="disabled"
										checked="checked"></td>
								</c:if>
							</tr>
						</c:forEach>
					</table>

					<input type="hidden" class="type">
				</form>
			</div>
			<button class="subtn2"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; left: 170px">
				确定</button>
			<button class="btn"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; right: 170px">
				关闭</button>
		</div>
		
		<div class="modal-data1">
			<div style="height: 60px">
				<ul>
					<li
						style="text-align: left; margin-left: 60px; height: 40px; line-height: 40px">
						<span>名称：</span> <span> <input class="name1" type="text">
					</span> <span>
							<button class="findBtn1">查询</button>
					</span>
					</li>
				</ul>
			</div>
			<div style="width: 1100px; height: 350px; overflow: scroll;">
				<form action="">
					<table class="head1"
						style="width: auto; white-space: nowrap; border-spacing: 0px">
						<tr style="background: #f2f2f2; height: 30px; line-height: 20px;"
							class="sel">
							<td style="width: 20px"></td>
							<td width="100px">名称</td>
							<td width="100px">编码</td>
							<td width="100px">简称</td>
							<td width="100px">描述</td>
							<td width="150px">创建时间</td>
							<td width="100px">用户名</td>
							<td width="150px">最后修改时间</td>
							<td width="100px">用户名</td>
						</tr>
						<c:forEach items="${oilspecs}" var="s">
						<tr style="margin-top: 45px" class="qygg">
						<td><input type="checkbox" class="check" value="${s.fid}" name="train2" /></td>
							<td>${s.fnameL2}</td>
							<td>${s.fnumber}</td>
							<td>${s.fsimplename}</td>
							<td>${s.fdescriptionL2}</td>
							<td>${s.fcreatetime}</td>
							<td>${s.createName}</td>
							<td>${s.flastupdatetime}</td>
							<td>${s.updateName}</td>
						</tr>
						</c:forEach>
					</table>
				</form>
			</div>
			<button class="subtn1"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; left: 170px">
				确定</button>
			<button class="btn"
				style="width: 200px; position: absolute; bottom: 25px; font-size: 16px; right: 170px">
				关闭</button>
		</div>	
			
					<c:if test="${empty otherCarAddOil}">
						<div class="weizhi">
							车辆管理>>其他车辆加油登记>>新增
						</div>
					</c:if>
					<c:if test="${not empty otherCarAddOil}">
						<c:if test="${otherCarAddOil.cfbillstate <= 3}">
						<div class="weizhi">
							车辆管理>>其他车辆加油登记>>修改
						</div>
					</c:if>
					</c:if>
					
					<c:if test="${not empty otherCarAddOil}">
						<c:if test="${otherCarAddOil.cfbillstate > 3}">
						<div class="weizhi">
							车辆管理>>其他车辆加油登记>>查看
						</div>
					</c:if>
					</c:if>
					
				<div class="div_body" style="box-shadow: 0 0 5px #cccccc;height: 950px">
					<div class="div_form">
					<!----------------------------- 新增 --------------------------------->
					<c:if test="${empty otherCarAddOil}">
						<form action="<%=path%>/DrivingSys/editOtherCarAddOil" class="form" method="post"
							  onsubmit="return verify();">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name"  value="${department.fnameL2}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text" name="fnumber" value="${fnumber}" style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${time}" 
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" 
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">备注&nbsp;:&nbsp;</span>
								<input name="fdescription"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">加油员&nbsp;:&nbsp;</span>
								<input name="addoilName" class="addoilName is_click_ne"/>
								<input type="hidden" name="cfaddoilpersonid">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" disabled="disabled">
									<option style="color: gray;">新增</option>
								</select>
							</div>
					</div>
					
					<div class="div_zilei">
						<div style="width: 60.5%;text-align: right;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color:#57a0ff;font-weight:700;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color:#57a0ff;font-weight:700;font-size: 14px" class="deleteTable">删除</span>
							</div>
					</div>
					<input type="hidden" class="stu">
							<div style="min-height: 500px;width: 61%;padding-left: 90px;position: relative;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td  width="20px"></td>
										<td  width="30px"></td>
										<td align="center">车辆</td>
										<td align="center">部门</td>
										<td align="center">油规格</td>
										<td align="center">加油量(公升)</td>
										<td align="center">备注</td>
									</tr>
							</table>
							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;display: none;margin-top: 100px;">
								<tr>
									<td width="64px" colspan="2">
										<input type="text" readonly="readonly" value="合计"
											   style="width: 64px;color: #cccccc;text-align: center;">
										</td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" value="0" readonly="readonly" id="sum"></td>
										<td><input type="text" readonly="readonly"></td>
								</tr>
							</table>
						</div>
					</div>
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input  readonly="readonly" value="${name}" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;"readonly="readonly" type="text"/>
							</div> 
					</div> 
					
					<div class="div_tj" style="padding-top: 20px;margin-left: 140px;">
						<div>
							<input class="input_submit bc" value="" type="submit" style="margin-top: 0px;margin-right: 30px;"/>
						</div>
						<div>
							<input type="button" class="input_back fh" value="" onclick="back()" style="margin-top: 0px;"/>
						</div>
					</div>
				</form>
				</c:if>
				
				<!----------------------------- 修改 --------------------------------->
					<c:if test="${not empty otherCarAddOil}">
						<c:if test="${otherCarAddOil.cfbillstate <= 3}">
						<form action="<%=path%>/DrivingSys/editOtherCarAddOil" class="form" method="post"
							  onsubmit="return verify();">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name"  value="${otherCarAddOil.companyName}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input  type="text" name="fnumber" value="${otherCarAddOil.fnumber}" style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${otherCarAddOil.fbizdate}" 
								onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})"/>
								<img onclick="WdatePicker({el:'ywrq',dateFmt:'yyyy-MM-dd'})" 
					            src="<%=path%>/image/date.jpg"  align="absmiddle" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">备注&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${otherCarAddOil.fdescription}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">加油员&nbsp;:&nbsp;</span>
								<input name="addoilName" class="addoilName is_click_ne"
									   value="${otherCarAddOil.addoilName}"/>
								<input type="hidden" name="cfaddoilpersonid" value="${otherCarAddOil.cfaddoilpersonid}">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" disabled="disabled">
									<option style="color: gray;">保存</option>
								</select>
							</div>
					</div>
					
					<div class="div_zilei">
						<div style="width: 60.5%;text-align: right;">
								<img src="<%=path%>/image/insert2323.jpg" class="addTable">
								<span style="padding-right: 20px;color:#57a0ff;font-weight:700;font-size: 14px" class="addTable">添加</span>
								<img src="<%=path%>/image/delete212.png" class="deleteTable">
								<span class="deleteTable" style="color:#57a0ff;font-weight:700;font-size: 14px" class="deleteTable">删除</span>
							</div>
					</div>
					<input type="hidden" class="stu">
							<input type="hidden" id="auditState" value="${AuditState}">
					<input type="hidden" id="fid" name="fid" value="${otherCarAddOil.fid}">
							<div style="min-height: 500px;width: 61%;padding-left: 90px;position: relative;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table1" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td  width="20px"></td>
										<td  width="30px"></td>
										<td align="center">车辆</td>
										<td align="center">部门</td>
										<td align="center">油规格</td>
										<td align="center">加油量(公升)</td>
										<td align="center">备注</td>
									</tr>
									<c:forEach items="${otherCarAddOilEntrys}" var="s">
									<tr style="margin-top: 45px" class="jx${s.fseq}">
										<td width="20px"><input type="checkbox" name="check" style="width: 15px"></td>
										<td>
											<input type="text" readonly="readonly" class="fseq2" value="${s.fseq}" style="width: 40px">
											<input type="hidden" name="fseq" class="fseq" value="${s.fseq}">
										</td>
										<td><input type="text" name="cfcar" class="cfcar" value="${s.cfcar}"></td>
										<td><input type="text" name="cfdept" class="cfdept" value="${s.cfdept}"></td>
										<td>
											<input type="text" name="oilName" class="oilName is_click_ne"
												   onclick="qygg($(this))" value="${s.oilName}">
											<input type="hidden" name="cfoilspecification" value="${s.cfoilspecification}"></td>
										<td><input type="text" name="cfqty" class="cfqty" onblur="cfqty2($(this))" value="${s.cfqty}"></td>
										<td><input type="text" name="cfremarks" class="cfremarks" value="${s.cfremarks}"></td>
									</tr>
								</c:forEach>
							</table>
							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;margin-top: 100px;">
								<tr>
									<td width="64px" colspan="2">
										<input type="text" readonly="readonly" value="合计"
											   style="width: 64px;color: #cccccc;text-align: center;">
										</td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" value="0" readonly="readonly" id="sum"></td>
										<td><input type="text" readonly="readonly"></td>
								</tr>
							</table>
						</div>
					</div>
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text" value="${otherCarAddOil.auditName}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input  readonly="readonly" value="${otherCarAddOil.createName}" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;"readonly="readonly" type="text" value="${otherCarAddOil.fcreatetime}"/>
							</div> 
					</div> 
					
						<div class="div_tj" style="padding-top: 0px">
                            <shiro:hasPermission name="/queryOtherCarAddOilByFid">
                                <div>
									<input class="input_submit bc" value="" type="submit">
                                </div>
                            </shiro:hasPermission>
							<shiro:hasPermission name="/submitOtherCarAddOil">
								<div style="padding-right: 50px">
									<input type="button" class="input_submit tj" value="" id="submit">
									<input type="hidden" value="1">
								</div>
							</shiro:hasPermission>
							<div>
								<input type="button" class="input_back fh" value="" onclick="back()"/>
							</div>
					</div>
				</form>
				</c:if>
				</c:if>
				
				<!----------------------------- 查看 --------------------------------->
					<c:if test="${not empty otherCarAddOil}">
						<c:if test="${otherCarAddOil.cfbillstate > 3}">
					<form action="<%=path%>/DrivingSys/editOtherCarAddOil" class="form">
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">驾校&nbsp;:&nbsp;</span>
								<input  type="text" name="name"  value="${otherCarAddOil.companyName}" readonly="readonly" style="color: gray;"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">单据编号&nbsp;:&nbsp;</span>
								<input type="text" name="fnumber" id="fnumber" value="${otherCarAddOil.fnumber}"
									   style="color: gray;" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">业务日期&nbsp;:&nbsp;</span>
								<input  type="text" name="fbizdate"  id="ywrq" value="${otherCarAddOil.fbizdate}" readonly="readonly"/>
								<img src="<%=path%>/image/date.jpg" style="padding-left: 15px">
							</div>
						</div>
						<div class="div_input_hang">
							<div class="input_hang">
								<span class="gn_name">备注&nbsp;:&nbsp;</span>
								<input name="fdescription" value="${otherCarAddOil.fdescription}" readonly="readonly"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">加油员&nbsp;:&nbsp;</span>
								<input name="addoilName"  value="${otherCarAddOil.addoilName}" readonly="readonly"/>
								<input type="hidden" name="cfaddoilpersonid" value="${otherCarAddOil.cfaddoilpersonid}">
							</div>
							<div class="input_hang">
								<span class="gn_name">单据状态&nbsp;:&nbsp;</span>
								<select name="cfbillstate" disabled="disabled">
									<c:if test="${otherCarAddOil.cfbillstate == 4}">
										<option style="color: gray;">提交</option>
									</c:if>
									<c:if test="${otherCarAddOil.cfbillstate == 5}">
										<option style="color: gray;">审核</option>
									</c:if>
								</select>
							</div>
					</div>
					
					<div class="div_zilei">
						<div style="width: 60.5%;text-align: right;">
									<%--<img src="<%=path%>/image/insert2323.jpg">
                                    <span style="padding-right: 20px;color: #a9bbe0;font-size: 14px">添加</span>
                                    <img src="<%=path%>/image/delete212.png">
                                    <span style="color: #a9bbe0;font-size: 14px">删除</span>--%>
							</div>
					</div>
						<input type="hidden" class="stu">
						<input type="hidden" id="state" value="${otherCarAddOil.cfbillstate}">
						<input type="hidden" id="type">
					<input type="hidden" id="fid" name="fid" value="${otherCarAddOil.fid}">
						<div style="min-height: 500px;width: 61%;padding-left: 90px;position: relative;">
					<div style="overflow:scroll;height: 500px;width: 100%"> 
							<table  width="100%" align="center" id="table3" style="min-height:50px;border-spacing:0;">
									<tr class="tr">
										<td  width="20px"></td>
										<td  width="30px"></td>
										<td align="center">车辆</td>
										<td align="center">部门</td>
										<td align="center">油规格</td>
										<td align="center">加油量(公升)</td>
										<td align="center">备注</td>
									</tr>
									<c:forEach items="${otherCarAddOilEntrys}" var="s">
									<tr style="margin-top: 45px" class="jx${s.fseq}">
										<td width="20px"><input type="checkbox" name="check" style="width: 15px" disabled="disabled"></td>
										<td>
											<input type="text" readonly="readonly" class="fseq2" value="${s.fseq}" style="width: 40px">
											<input type="hidden" name="fseq" class="fseq" value="${s.fseq}">
										</td>
										<td><input type="text" name="cfcar" class="cfcar" value="${s.cfcar}"readonly="readonly" ></td>
										<td><input type="text" name="cfdept" class="cfdept" value="${s.cfdept}" readonly="readonly"></td>
										<td>
											<input type="text" name="oilName" class="oilName" readonly="readonly" value="${s.oilName}">
											<input type="hidden" name="cfoilspecification" value="${s.cfoilspecification}"></td>
										<td><input type="text" name="cfqty" class="cfqty" readonly="readonly" value="${s.cfqty}"></td>
										<td><input type="text" name="cfremarks" class="cfremarks" value="${s.cfremarks}" readonly="readonly"></td>
									</tr>
								</c:forEach>
							</table>
							<table align="center" id="table2" style="height:45px;overflow:scroll;border-spacing:0;margin-top: 100px;">
								<tr>
										<td width="40px" colspan="2">
											<input type="text" readonly="readonly" value="合计"
												   style="width: 64px;color: #cccccc;text-align: center;">
										</td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" readonly="readonly"></td>
										<td><input type="text" value="0" readonly="readonly" id="sum"></td>
										<td><input type="text" readonly="readonly"></td>
								</tr>
							</table>
						</div>
					</div>
					
					 <div class="div_input_hang" style="margin-top: 50px">
							<div class="input_hang">
								<span class="gn_name">审核人&nbsp;:&nbsp;</span>
								<input name="fhandlerid" readonly="readonly" style="color: gray;" type="text" value="${otherCarAddOil.auditName}"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建者&nbsp;:&nbsp;</span>
								<input  readonly="readonly" value="${otherCarAddOil.createName}" style="color: gray;" type="text"/>
							</div>
							<div class="input_hang">
								<span class="gn_name">创建时间&nbsp;:&nbsp;</span>
								<input name="fcreatetime" style="color: gray;"readonly="readonly" type="text" value="${otherCarAddOil.fcreatetime}"/>
							</div> 
					</div> 
					
					<div class="div_tj">
                        <c:if test="AuditState == true">
                            <shiro:hasPermission name="/auditOtherCarAddOil">
                                <div style="padding-right: 50px">
                                    <input type="button" class="input_submit sh" value="" id="sh">
                                    <input type="hidden" value="1">
                                </div>
                            </shiro:hasPermission>
                        </c:if>
						<shiro:hasPermission name="/againstAuditOtherCarAddOil">
							<div style="padding-right: 50px">
								<input type="button" class="input_submit fsh" value="" id="fsh">
							<input type="hidden" value="2">
						</div>
						</shiro:hasPermission>
						<div>
							<input type="button" class="input_submit cklc" value=""
								   onclick="lookActivitiImg('${key}',$('#fnumber').val())"/>
						</div>
						<div>
							<input type="button" class="input_back fh" value="" onclick="back()"/>
						</div>
				</div>
				</form>
				</c:if>
				</c:if>
		</div>
	</div>
</div>
</body>
<script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script type="text/javascript" src="<%=path%>/HoganJS/handlebars-v4.0.11.js"></script>
<script type="text/javascript">

$(document).ready(function(){
	var type = "${type}"
	if(type == null || type == ''){
		
	}else{
        editAlert();
	}
})

//删除行
$(".deleteTable").click(function(){
	var tr_len = $("#table1 tr").length;
	if(tr_len == 1){
		
	}else{
		var s = '';
		$('input:checkbox[name=check]').each(function(i) {
			if($(this).is(':checked')){
				$(this).parent().parent().remove();
				//计算
				jsze()
				s = '1';
			}
		})
		//判断是否选中
		if(s == null || s == ''){
			alert("请选择一条数据删除");
			return false;
		}
		if($("#table1 tr").length == '1'){
			$("#table2").css('display','none')
		}
		//重新排序
		$('#table1 tr td .fseq').each(function(i) {
			var s = i*1 + 1*1;
			$(this).val(s);
			$(this).prev().val(s);
			$(this).parent().parent().attr("class",'jx'+s);
		})
	}
})
//返回
function back(){
    parent.closeSelectCard()

//    location = '<%=path%>/DrivingSys/queryOtherCarAddOil/look.action';
}

//添加一行
$('.addTable').click(function(){
	 var tr_len = $("#table1 tr").length;
	 var str = ""
	 str+='<tr style="margin-top: 45px" class=jx'+tr_len+'>'
	 str+='<td width="20px"><input type="checkbox" name="check" style="width: 15px"></td>'
	 str+='<td><input type="text" readonly="readonly" class="fseq2" value='+tr_len+' style="width: 40px"><input type="hidden" name="fseq" class="fseq" value='+tr_len+'></td>'
	 str+='<td><input type="text" onblur="selectInfo(this)" name="cfcar" class="cfcar"></td>'
	 str+='<td><input type="text" name="cfdept" class="cfdept"></td>'
    str += '<td><input type="text" name="oilName" class="oilName is_click_ne" onclick = "qygg($(this))"><input type="hidden" name="cfoilspecification"></td>'
	 str+='<td><input type="text" name="cfqty" class="cfqty" onblur="cfqty2($(this))"></td>'
	 str+='<td><input type="text" name="cfremarks" class="cfremarks"></td>'
	 $("#table1").append(str)
	 $("#table2").show()
})

 //可以输入小数点
 $(".cfqty").live('keyup', function(event) {
	//最后一位是小数点的话，移除
	var $amountInput = $(this);
	//响应鼠标事件，允许左右方向键移动 
	event = window.event || event;
	if(event.keyCode == 37 | event.keyCode == 39) {
		return;
	}
     //获取父类class名称
     var superclass = $(this).parent().parent().prop("class")
	var clazz = $(this).prop("class")
	//获取输入框的值
	var value = $('.'+clazz+'').val();
	//判断负数是否在第一位
	 if(value.substring(0,1) == '-'){
		
	 }
	//判断负数不是在第一位，替换
	 if(value.lastIndexOf('-') > 0){
         $('.superclass .' + clazz + '').val("")
		// $amountInput.val($amountInput.val().replace('-','')
	 }
	//先把非数字的都替换掉，除了数字和. 
	$amountInput.val($amountInput.val().replace(/[^\-?\d.]/g, "").
	//只允许一个小数点              
	replace(/^\./g, "").replace(/\.{2,}/g, ".").
	//只能输入小数点后两位
	replace(".", "$#$").replace(/\./g, "").replace("$#$", ".").replace(/^(\-)*(\d+)\.(\d\d).*$/, '$1$2.$3'));
});

//开启职员弹框
$(".addoilName").click(function(){
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data2').css('visibility','visible')
})

//开启汽油规格弹框
function qygg(_this){
	var jx = _this.parent().parent().prop("class");
	$(".stu").val(jx)
	$('#modal-overlay').css('visibility','visible')
	$('.modal-data1').css('visibility','visible')
}

/* 关闭弹出框    */
$('.btn').live('click',function(){
	$('#modal-overlay').css('visibility','hidden')
	$('.modal-data2').css('visibility','hidden')
	$('.modal-data1').css('visibility','hidden')
})


//根据名称查询职员
$(".findBtn2").click(function(){
	var name = $(".name").val();
	$.ajax({
		url:'<%=path%>/DrivingSys/quePersonByName', 
	    type: "post",
	    data:{'name':name},
	    dataType:"json",
	    success:function(json){
	    	var str = '';
	    	for (var i = 0; i < json.length; i++) {
				str += '<tr style="margin-top: 45px;height: 30px;" class="jx"><td><input style="width: 15px;height: 15px" '
	  	         str+='type="checkbox" name="train"  value="'+json[i].fid+'"></td>'
				if (json[i].fnumber == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].fnumber + '</td>'
				}
				if (json[i].fnameL2 == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].fnameL2 + '</td>'
				}
				if (json[i].cfpersondepName == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfpersondepName + '</td>'
				}
				if (json[i].cfpersontype == '1') {
					str += '<td>办公室职员</td>'
				} else if (json[i].cfpersontype == '2') {
					str += '<td>教练</td>'
				} else if (json[i].cfpersontype == '3') {
					str += '<td>其他</td>'
				} else {
					str += '<td></td>'
				}
				if (json[i].cfidcardno == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfidcardno + '</td>'
				}
				if (json[i].cfcell == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfcell + '</td>'
				}
				if (json[i].cfaddress == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfaddress + '</td>'
				}
				if (json[i].cfbirthdays == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfbirthdays + '</td>'
				}
				if (json[i].cfbegindate == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfbegindate + '</td>'
				}
				if (json[i].cfstartdate == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfstartdate + '</td>'
				}
				if (json[i].cfenddate == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfenddate + '</td>'
				}
				if (json[i].cfhtdqsj == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfhtdqsj + '</td>'
				}
				if (json[i].cfhtdqsj == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfaccountsno + '</td>'
				}
				if (json[i].cfcarName == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfcarName + '</td>'
				}
				if (json[i].cfsex == '1') {
					str += '<td>男</td>'
				} else if (json[i].cfsex == '2') {
					str += '<td>女</td>'
				} else {
					str += '<td></td>'
				}
				if (json[i].positiongradeName == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].positiongradeName + '</td>'
				}
				if (json[i].cfxctz == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfxctz + '</td>'
				}
				if (json[i].cfgwyd == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfgwyd + '</td>'
				}
				if (json[i].cfqjjl == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfqjjl + '</td>'
				}
				if (json[i].cfwjjljl == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfwjjljl + '</td>'
				}
				if (json[i].cfshjljl == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].cfshjljl + '</td>'
				}
				if (json[i].cfzstc == '0') {
					str += '<td><input type="checkbox" disabled="disabled"></td>'
				} else if (json[i].cfzstc == '1') {
					str += '<td><input type="checkbox" disabled="disabled" checked="checked"></td>'
				} else {
					str += '<td><input type="checkbox" disabled="disabled"></td>'
				}
				if (json[i].cfpxtc == '1') {
					str += '<td><input type="checkbox" disabled="disabled" checked="checked"></td>'
				} else {
					str += '<td><input type="checkbox" disabled="disabled"></td>'
				}
				str += '</tr>';
	    	}
	    	$(".head2 tr:not(':first')").remove()
			$('.head2').append(str)
	    },  
			error: function(){alert('错误！！！');} 
	})
})
   //单击汽油规格
 $(".qygg td").live('click',function(){
    $('input:checkbox[name=train2]:checked').each(function(i) {
    	$(this).removeAttr("checked");
     });
       $(this).parent().find("input:checkbox").attr('checked','checked');
  }) 
  
   //单击职员
 $(".jx td").live('click',function(){
    $('input:checkbox[name=train]:checked').each(function(i) {
    	$(this).removeAttr("checked");
     });
       $(this).parent().find("input:checkbox").attr('checked','checked');
  }) 

 //由于和input:checkbox冲突，在选择一次
 $("#table1 tr td input:checkbox").live('click',function(){
	 if($(this).is(':checked')){
	    	$(this).removeAttr("checked");
	    }else{
	    	$(this).attr("checked",":checked")
	    }
 })
  //单击选中
  $("#table1 tr td").live('click',function(){
    if($(this).parent().find("input:checkbox").is(':checked')){
    	$(this).parent().find("input:checkbox").removeAttr("checked");
    }else{
    	$(this).parent().find("input:checkbox").attr("checked",":checked")
    }
 }) 

 //根据名称查询汽油规格
$(".findBtn1").click(function(){
	var name = $(".name1").val();
	$.ajax({
		url:'<%=path%>/DrivingSys/queOilspecByName', 
	    type: "post",
	    data:{'name':name},
	    dataType:"json",
	    success:function(json){
	    	var str = '';
	    	for (var i = 0; i < json.length; i++) {
				str += '<tr style="margin-top: 45px;height: 30px;" class="qygg"><td><input style="width: 15px;height: 15px" '
	  	         str+='type="checkbox" name="train2"  value="'+json[i].fid+'"></td>'
				if (json[i].fnameL2 == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].fnameL2 + '</td>'
				}
				if (json[i].fnumber == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].fnumber + '</td>'
				}
				if (json[i].fsimplename == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].fsimplename + '</td>'
				}
				if (json[i].fdescriptionL2 == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].fdescriptionL2 + '</td>'
				}
				if (json[i].fcreatetime == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].fcreatetime + '</td>'
				}
				if (json[i].createName == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].createName + '</td>'
				}
				if (json[i].flastupdatetime == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].flastupdatetime + '</td>'
				}
				if (json[i].updateName == null) {
					str += '<td></td>'
				} else {
					str += '<td>' + json[i].updateName + '</td>'
				}
	    	}
	    	$(".head1 tr:not(':first')").remove()
			$('.head1').append(str)
	    },  
			error: function(){alert('错误！！！');} 
	})
})
 
   //选择职员数据
   $('.subtn2').live('click',function () {
  	 var fid;//fid
  	 var name;//名称
  	 $('input:checkbox[name=train]:checked').each(function (i) {
  	         if (0 == i) {
  	        	 fid = $(this).val();
  	        	 name = $(this).parent().next().next().text();
  	         }
  	 });
  	 if(name == ""){
  		alert("请至少选择一条数据")
  		return false
  	}
  		personData(fid,name);
   });
   
   //双击确定职员数据
     $(document).on('dblclick','.jx td',function(){
    	 var fid;//fid
      	 var name;//名称
  		 $('input:checkbox[name=train]:checked').each(function (i) {
  			  if (0 == i) {
  				 fid = $(this).val();
  	        	 name = $(this).parent().next().next().text();
  			   } 
  		 });
  		personData(fid,name);
     })
  //放入职员数据
  function personData(fid,name){
   	 $(".addoilName").val(name);
   	 $(".addoilName").next().val(fid);
  	 $('#modal-overlay').css('visibility','hidden')
  	 $('.modal-data2').css('visibility','hidden')
  }
 
     //选择汽油规格数据
     $('.subtn1').live('click',function () {
    	 var fseq = $(".stu").val();
    	 var fid;//fid
    	 var name;//名称
    	 $('input:checkbox[name=train2]:checked').each(function (i) {
    	         if (0 == i) {
    	        	 fid = $(this).val();
    	        	 name = $(this).parent().next().text();
    	         }
    	 });
    	 if(name == ""){
    		alert("请至少选择一条数据")
    		return false
    	}
    		oilspecData(fseq,fid,name);
     });
     
     //双击确定汽油规格数据
       $(document).on('dblclick','.qygg td',function(){
    	 var fseq = $(".stu").val();
      	 var fid;//fid
         var name;//名称
    		 $('input:checkbox[name=train2]:checked').each(function (i) {
    			  if (0 == i) {
    				 fid = $(this).val();
    	        	 name = $(this).parent().next().text();
    			   } 
    		 });
    		 oilspecData(fseq,fid,name);
       })
    //放入职员数据
    function oilspecData(fseq,fid,name){
     	 $('.'+fseq+'').find(".oilName").val(name);
     	$('.'+fseq+'').find(".oilName").next().val(fid);
    	 $('#modal-overlay').css('visibility','hidden')
    	 $('.modal-data1').css('visibility','hidden')
    }
 
  //计算加油量
 function cfqty2(_this){
	//避免最后一个字符串是.
	_this.val((_this.val().replace(/\.$/g, "")));
	if(_this.val() == '-'){
		_this.val("")
	}
     //判断输入错误
     if (isNaN(Number(_this.val()))) {
         _this.val("")
     }
	//计算
	jsze()
 }
   
//计算加油量总额
 function jsze(){
	//加油量总额
	var cfqty = 0;
	$(".cfqty").each(function(i){
		var s = $(this).val();
		if(s == null || s == ''){
			s = 0;
		}
		cfqty = (cfqty*1) + (s*1);
		cfqty = decimal(cfqty,2);
	})
	$("#sum").val(cfqty)
}

//num是要处理的数字  v为要保留的小数位数
 function decimal(num,v){
 	var vv = Math.pow(10,v);
 	return Math.round(num*vv)/vv;
 }

//审核,反审核弹框
$("#sh,#fsh").click(function () {
    var type = $(this).next().val();
    $("#type").val(type)
    if (type == 1) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data9').css('visibility', 'visible')
        $('li input:radio:first').attr('checked', 'checked');
    }
    else if (type == 2) {
        $('#modal-overlay').css('visibility', 'visible')
        $('.modal-data10').css('visibility', 'visible')
    }
})

//审核,反审核
$("#auditsubmit,#againstAuditsubmit").click(function () {
    //防止重复提交
    $(this).attr("disabled", "disabled")
    var state = $('li input[type="radio"]:checked ').val();//同意/不同意
    var fid = $("#fid").val();//fid
    var fnumber = $("input[name='fnumber']").val();//编码
    var type = $("#type").val();
    var message;
    if (type == '1') {
        message = $("#auditcomment").val();
    } else {
        message = $("#againstAuditcomment").val();
    }
    $.ajax({
        url: '<%=path%>/DrivingSys/auditOtherCarAddOil',
        type: "post",
        data: {'fid': fid, 'type': type, 'fnumber': fnumber, 'message': message, 'state': state},
        dataType: "json",
        success: function (json) {
            var url = '/queryOtherCarAddOil/look.action';
            if (type == '1') {
                if (json == '1') {
                    showAlert('审核成功,并且此流程已结束', url)
                } else if (json == '2') {
                    showAlert('审核成功', url)
                } else {
                    showAlert('审核失败', url)
                }
            } else {
                if (json == '1') {
                    showAlert('反审核成功', url)
                } else if (json == '2') {
                    showAlert('没有找到任务', url)
                } else if (json == '0') {
                    showAlert('找不到流程节点', url)
                }
            }
        },
        error: function () {
            $("#againstAuditsubmit,#auditsubmit").attr("disabled", false)//去除input元素的disabled属性
            alert('错误');
        }
    })
})

//提交
$("#submit").click(function () {
    $.messager.confirm('提示', '是否提交,提交后不会改变修改后的值', function (r) {
        if (r) {
            var url = '/queryOtherCarAddOil/look.action';
            var fid = $("#fid").val();
            var fnumber = $("input[name='fnumber']").val();
            var auditState = $("#auditState").val();
            $.ajax({
                url: '<%=path%>/DrivingSys/submitOtherCarAddOil',
                type: "post",
                data: {'fid': fid, 'fnumber': fnumber, 'auditState': auditState},
                dataType: "json",
                success: function (json) {
                    if (json == 1) {
                        showAlert('提交成功', url)
                    } else {
                        showAlert('提交失败', url)
                    }
                },
                error: function () {
                    alert('错误');
                }
            })
        }
    })
})

  //当前加载计算总和
window.onload=function() {
	//计算刷卡金额
	jsze()
}

//验证单据下是否有数据
function verify() {
    var s = 0;
    var a = 0;
    $("input[name='cfcar']").each(function () {
        if ($(this).val() == '' || $(this).val() == null) {
            a = 1;
        } else {
            s = 1;
        }

    })
    var ywrq = $("#ywrq").val();
    if (ywrq == null || ywrq == '') {
        alert("业务日期不能为空");
        return false;
    }

    if (a == 1) {
        alert("车辆不能为空")
        return false;
    }

    if (s == 0) {
        alert("请至少添加一条数据");
        return false;
    }
    $("input[type='submit']").attr("disabled", "disabled");
}

	function selectInfo(_this) {
		var $this = $(_this)
		var carName = $this.val()
        $.ajax({
            url:'<%=path%>/DrivingSys/selCarAddOilByName',
            type: "post",
            data:{'carName':carName},
            dataType:"json",
            success:function(json){
                $this.val(json.cfcar)
                $this.parent().next().find('input[name="cfdept"]').val(json.cfdept)
                $this.parent().next().next().find('input[name="oilName"]').val(json.oilName)
                $this.parent().next().next().find('input[name="cfoilspecification"]').val(json.cfoilspecification)
            },
            error: function(){alert('错误！！！');}
        })
    }

</script>
</html>